package cc.rengu.igas.bomp.common.enums;

import cc.rengu.oltp.utility.util.StringUtil;

/**
 * 微信实名认证主体信息
 *
 * @author bank
 * @version 1.0
 * @date 2019/08/15
 */
public enum WechatSubjectTypeEnum {

    SUBJECT_TYPE_ENTERPRISE("SUBJECT_TYPE_ENTERPRISE", "企业", "03"),
    SUBJECT_TYPE_INSTITUTIONS_CLONED("SUBJECT_TYPE_INSTITUTIONS_CLONED", "事业单位", "04"),
    SUBJECT_TYPE_INDIVIDUAL("SUBJECT_TYPE_INDIVIDUAL", "个体工商户", "02"),
    SUBJECT_TYPE_OTHERS("SUBJECT_TYPE_OTHERS", "其他组织", "99"),
    SUBJECT_TYPE_MICRO("SUBJECT_TYPE_MICRO", "小微商户", "01"),
    ;

    public static String getWechatSubjectTypeByMchntNature(String mchntNature) {
        if (StringUtil.isEmptyOrNull(mchntNature)) {
            return null;
        }
        for (WechatSubjectTypeEnum wechatSubjectTypeEnum : WechatSubjectTypeEnum.values()) {
            if (wechatSubjectTypeEnum.getMchntNature().equals(mchntNature)) {
                return wechatSubjectTypeEnum.getType();
            }
        }
        return null;
    }

    private String type;

    private String desc;

    private String mchntNature;

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public String getMchntNature() {
        return mchntNature;
    }

    WechatSubjectTypeEnum(String type, String desc, String mchntNature) {
        this.type = type;
        this.desc = desc;
        this.mchntNature = mchntNature;
    }
}
